<!DOCTYPE html>
<!-- saved from url=(0082)https://dc.chengdurail.com:8443/jd/cashier/finish.html?o=%25s&m=%25s&n=%25s&t=%25s -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>支付完成</title>
    <style>
        html {
            font-size: 4vw;
        }

        /* 确认框样式 */
        .confirmation-box {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-evenly;
            /* background: rgba(0, 0, 0, 0.5); */
            z-index: 9999;
        }

        .imgbox{
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .icon{
            width: 60px;
        }
        .money{
            font-size: 40px;
        }
        .num{
            font-size: 32px;
            vertical-align: top;
        }
        .finish{
            width: 150px;
            height: 30px;
            text-align: center;
            line-height: 30px;
            color: #59d494;
            background: #fff;
            border: 1px solid #39c076;
            border-radius: 4px;
            font-size: 16px;
        }
    </style>
</head>

<body>
    <!-- 确认框 -->
    <div class="confirmation-box">
        <div class="imgbox">
            <img src="./icon/logo.svg" alt="" class="icon">
            <span style="color: #0dbb60;font-size: 16px;">扣费成功</span>
        </div>
        <div class="money">
            <b class="num">￥</b><b class="price"></b> 
        </div>
        <div class="finish" onclick="closePage()">完成</div>
        <!-- <div class="confirmation-box-content">
            <h2>支付完成</h2>
            <p>您的支付已经完成</p>
            <button onclick="closePage()">确认</button>
        </div> -->
    </div>
    <script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
    <script>	
		var urlParams = new URLSearchParams(window.location.search);
		console.log(urlParams);
		var uid = urlParams.get("uid");
		var price = urlParams.get("price");
		document.querySelector('.price').innerHTML = price;
        // 关闭页面函数
        function closePage() {
            window.location.href = `/admin/v1.0/api/open/jd/auth?uid=${uid}`
            // wxClose()
            // let userAgent = navigator.userAgent;
            // if (userAgent.indexOf("Firefox") != -1 || userAgent.indexOf("Chrome") != -1) {
            //     location.href = "about:blank";
            // } else {
            //     window.opener = null; window.open('', '_self');99999001
            // }
            // window.close();
        }
        // var urlParams = new URLSearchParams(window.location.search);
        // console.log(urlParams);
        // var uid = urlParams.get("uid");
        // var price = urlParams.get("price");
        // document.querySelector('.price').innerHTML = price;
        var wxClose = function () {
            
            var xhr = new XMLHttpRequest();
            var url = `https://dc.chengdurail.com:8443/member-center/v1.0/api/open/jd/auth?uid=${uid}`;
            xhr.open("GET", url, true);
            xhr.setRequestHeader("Content-Type", "application/json");
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4 && xhr.status === 200) {
                    var response = JSON.parse(xhr.responseText);
                    console.log(response);
                }
            };

            xhr.send();
            setTimeout(function () {
                //关闭页面
                document.addEventListener('WeixinJSBridgeReady', function () {
                    WeixinJSBridge.call('closeWindow');
                }, false);
                //关闭页面
                WeixinJSBridge.call('closeWindow');
            }, 10);

            window.close();//PC浏览器使用。
        }
    </script>


</body></html>